from datetime import datetime


class Entity(object):

    def get_parameter_names(self):
        return list(self.__dict__.keys())

    def get_parameter_values(self, keys):
        values = []
        for key in keys:
            value = self.__dict__.get(key, None)
            if isinstance(value, int) or isinstance(value, float):
                values.append(str(value))
                continue

            if isinstance(value, str):
                value = value  # .encode('utf-8')
            if value == b'\x00':
                value = ""
            value = '"' + str(value) + '"'
            values.append(value)
        return values

    def __str__(self):
        return str(self.__dict__)


class AddFriendRecord(Entity):

    def __init__(self):
        self.id = ""
        self.company_id = ""
        self.customer_id = ""
        self.case_id = ""
        self.add_way = ""
        self.robot_id = ""
        self.req_time = ""
        self.contact_id = ""
        self.tel = ""
        self.nick_name = ""
        self.alias_name = ""
        self.status = ""
        self.session_id = ""
        self.create_time = datetime.now()
        self.update_time = datetime.now()

    def __str__(self):
        return str({})
